package com.beimihu.leetcode;

public class StringReverse {
    public static char[] Palindromic(String str){
        String string = str.replaceAll("[^0-9a-zA-Z]","");
        System.out.print(string);
        string = string.toLowerCase();
        System.out.print(string);
        return string.toCharArray();
    }

    public static void main(String[] args) {
        String str = "A man, a plan, a canal: Panama";

        int p = 0;
        char[] chars = Palindromic(str);
        int q = chars.length - 1;
        while (p < q){
            if(chars[p] != chars[q]){
                System.out.println("false");
                break;
            }
            p++;
            q--;
        }

    }
}
